<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script type="text/javascript" src="http://127.0.0.1/c45_classCode/Static/uploadify/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="http://127.0.0.1/c45_classCode/Static/uploadify/jquery.uploadify.min.js"></script>
	<link href="http://127.0.0.1/c45_classCode/Static/uploadify/uploadify.css" type="text/css" rel="stylesheet"></link>
	<link type="text/css" rel="stylesheet" href="http://127.0.0.1/c45_classCode/Static/hdjs/hdjs.css"/>
	<script type="text/javascript" src="http://127.0.0.1/c45_classCode/Static/hdjs/hdjs.min.js"></script>
	<style type="text/css">
		.liImg{
			width:80px;
			position: relative;
		}
		.closeBtn{
			width:15px;
			height: 15px;
			line-height: 15px;
			text-align: center;
			background: #FFF;
			cursor: pointer;
			position: absolute;
			top:0px;
			right: 0px;
		}
		.closeBtn:hover{
			background: #ccc;
		}
	</style>	
</head>
<body>
	<div class="hd-menu-list">
	    <ul>
	        <li><a href="<?php echo U('Flink/index');?>">友链列表</a></li>
	        <li class="active"><a href="<?php echo U('Flink/add');?>">添加友链</a></li>

	    </ul>
	</div>
	<form action="" method="post">
		<table class="hd-table hd-table-form hd-form">
		    <thead>
		    <tr>
		        <td colspan="2">添加友链</td>
		    </tr>
		    </thead>
		    <tbody>
		            <?php
        //初始化
        $hd['list']['d'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($data)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($data as $d) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][d]['index']++;
                //第1个值
                $hd['list'][d]['first']=($listId == 0);
                //最后一个值
                $hd['list'][d]['last']= (count($data)-1 <= $listId);
                //总数
                $hd['list'][d]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>	
			    <tr>
			    	<th><?php echo $d['title'];?></th>
			    	<td><?php echo $d['html'];?></td>
			    </tr>
			<?php }}?>
		    <tr>
		    	<th></th>
		    	<td>
		    		<input type="submit" value="保存">
		    	</td>
		    </tr>
		    </tbody>
		</table>
	</form>
</body>
</html>